﻿using System.Collections.Generic;
using log4net;
using Metozis.Model;

namespace Metozis.Data
{
    internal class Db
    {
        private ILog log;
        private IProductDb productDb;

        public Db(ILog log,IProductDb productDb)
        {
            this.log = log;
            this.productDb = productDb;
        }

        public IEnumerable<ReceipientInvoice> GetInvoices()
        {
            log.InfoFormat("Metozis.Data.Db.GetInvoices()");

            return new List<ReceipientInvoice>
            {
                new ReceipientInvoice {Id = 1, ProductId = 1},
                new ReceipientInvoice {Id = 2, ProductId = 2},
                new ReceipientInvoice {Id = 3, ProductId = 3},
                new ReceipientInvoice {Id = 4, ProductId = 4},
                new ReceipientInvoice {Id = 5, ProductId = 5}
            };
        }

        public IEnumerable<Product> GetProducts()
        {
            return productDb.GetAllProducts();
        }
    }
}